/**
* @file adis16460.h in ADIS16460_Reader
* @author rebeater
* @comment
* Create on 2021/1/29 下午8:06
* @version 1.0
**/

#ifndef ADIS16460_READER_ADIS16460_H
#define ADIS16460_READER_ADIS16460_H

#include <spi.h>
#include "nav_struct.h"

/*use for convert ImuRawAdi to ImuData*/
extern const double adis16460_ka_g;
extern const double adis16460_kg;

/*ADIS16460中读取到的所有数据*/
//#pragma pack(2)
typedef struct {
    uint16_t stat;/*STAT_OUT*/
    int16_t gyro[3];
    int16_t acce[3];
    int16_t temp;/*TEMP_OUT*/
    uint16_t cnt;/*SMPL_CNTR*/
    uint16_t checksum;
    uint32_t id;
    double gpst;/*放在最后，前面直接copy*/
} ImuRawAdi; /*size of ADI=2+2*3+2*3+2+2+2+8 =32 bytes*/
//#pragma pack()
#ifdef __cplusplus
extern "C" {
#endif

void adis16460_init();

int adis16460_burst_read(ImuRawAdi *imu);

void convert_adi_to_double(ImuRawAdi *adi,ImuData *imu);


#ifdef __cplusplus
}
#endif
#endif //ADIS16460_READER_ADIS16460_H
